<template>
    <AtTabBar
        fixed
        style="margin-top:90px;"
        :fontSize="11"
        color="#666"
        selectedColor="#4fcc8d"
        :tabList="[
            { title: '首页推荐', image: '/pages/img/home.png',selectedImage:'/pages/img/acthome.png'},
            { title: '一键回收', image: '/pages/img/recycle.png',selectedImage:'/pages/img/actrecycle.png' },
            { title: '个人中心', image: '/pages/img/my.png',selectedImage:'/pages/img/actmy.png', dot: true }
        ]"
        :onClick="handleClick"
        :current="current"
    />
</template>
<script setup>
import { onMounted, reactive, ref,getCurrentInstance ,computed} from 'vue'
import Taro from "@tarojs/taro"

const current = computed(()=>{
    return Taro.getStorageSync("current")
})
const handleClick = (val)=>{
    Taro.setStorageSync('current',val)

    switch (val) {
        case 0:
            Taro.switchTab({
                url: '/pages/index/index'
            })
            break;
        case 1:
            Taro.switchTab({
                url: '/pages/recycle/recycle'
            })
        break;
        case 2:
            Taro.switchTab({
                url: '/pages/my/my'
            })
        break;
    
        default:
            break;
    }
}

</script>
<style lang="scss">

</style>
